<template>
  <div class="content">
    <rotation />
    <template v-if="['/home/index'].includes(path)">

      <div class="poster-jump">
          <div class="part thumb" v-for="item in homeJump" @click="()=>go(item.url)">
             <div class="img">
               <img :src="item.img">
              </div>
          </div>
      </div>

      <coupon />
      <manufactor />
      <square />
      <shop />
    </template>
    <template v-else>
      <SupplierTitle />
      <SupplierContent />
    </template>
  </div>
</template>
<script setup lang="ts" name="">
import rotation from "./components/Rotation/index.vue";
import coupon from "./components/Coupon/index.vue";
import manufactor from "./components/Manufactor/index.vue";
import square from "./components/Square/index.vue";
import shop from "./components/Shop/index.vue";
import SupplierTitle from "./components/SupplierTitle/index.vue";
import SupplierContent from "./components/SupplierContent/index.vue";

import { computed,ref } from "vue";
import { useRoute,useRouter } from "vue-router";
import { publicUrl } from "@/utils/util";
const route = useRoute();
const router = useRouter();
const path = computed(() => route.path);
interface HomeJump{
      img:string;
      url:string;
}

const homeJump = ref<Array<HomeJump>>([
  {
  img:'/client/images/masonry-big.png',
  url:'/client/mtm/index?activeName=0'
 },
  {
  img:'/client/images/masonry-big.png',
  url:'/client/mtm/spot/index?activeName=1'
 },
  {
  img:'/client/images/masonry-big.png',
  url:'/client/mtm/fabric/index?activeName=2'
 },
  {
  img:'/client/images/masonry-big.png',
  url:'/client/mtm/spot/ingredients?activeName=1'
 },
  {
  img:'/client/images/masonry-big.png',
  url:'/client/mtm/spot/clothes?activeName=1'
 },

]);

const go = (url:string)=>{
  window.location.href = url
}

</script>
<style scoped lang="scss">
@media screen and (min-width: $pc-min-width) {
  @import "./index.scss";
}
</style>
